.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.dialog-container {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: dialog-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialog-fade-in {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, #fafafa, #f5f5f5);
  border-radius: 12px 12px 0 0;

  h2 {
    font-size: 20px;
    font-weight: 600;
    color: #262626;
    margin: 0;
    letter-spacing: -0.5px;
  }

  .close-button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: #8c8c8c;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      background: rgba(0, 0, 0, 0.06);
      color: #262626;
    }
  }
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.form-section {
  background: white;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #f0f0f0;
  overflow: hidden;

  h3 {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin: 0;
    padding: 16px 24px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
  }

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;

    h3 {
      padding: 0;
      background: none;
      border: none;
    }

    .btn-add {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      border: 1px solid #1890ff;
      border-radius: 6px;
      background: white;
      color: #1890ff;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s;

      &:hover {
        background: #e6f7ff;
      }

      i {
        font-size: 14px;
      }
    }
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;

  &.full-width {
    grid-column: 1 / -1;
  }

  label {
    color: #262626;
    font-size: 14px;
    font-weight: 500;

    .required {
      color: #ff4d4f;
      margin-left: 4px;
    }
  }

  input,
  select,
  textarea {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
    background: white;

    &:hover {
      border-color: #40a9ff;
    }

    &:focus {
      border-color: #1890ff;
      box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
      outline: none;
    }

    &:disabled {
      background: #f5f5f5;
      cursor: not-allowed;
    }
  }

  textarea {
    resize: vertical;
    min-height: 80px;
  }

  .input-group {
    display: flex;
    align-items: center;

    input {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    .input-group-append {
      .input-group-text {
        height: 100%;
        padding: 0 12px;
        background: #fafafa;
        border: 1px solid #d9d9d9;
        border-left: none;
        border-radius: 0 6px 6px 0;
        display: flex;
        align-items: center;
        gap: 8px;
        color: #595959;
        font-size: 14px;

        input[type="checkbox"] {
          width: 16px;
          height: 16px;
          margin: 0;
        }
      }
    }

    .btn-select {
      padding: 8px 12px;
      background: #fafafa;
      border: 1px solid #d9d9d9;
      border-left: none;
      border-radius: 0 6px 6px 0;
      cursor: pointer;
      color: #595959;
      transition: all 0.3s;

      &:hover {
        background: #f0f0f0;
        color: #262626;
      }

      i {
        font-size: 14px;
      }
    }
  }
}

.locations-table {
  padding: 0 24px 24px;
  overflow-x: auto;

  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;

    th, td {
      padding: 12px;
      text-align: left;
      font-size: 14px;
      border-bottom: 1px solid #f0f0f0;
    }

    th {
      background: #fafafa;
      font-weight: 600;
      color: #262626;
      white-space: nowrap;

      .required {
        color: #ff4d4f;
        margin-left: 4px;
      }
    }

    td {
      color: #595959;

      input,
      select {
        width: 100%;
        padding: 6px 8px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        font-size: 14px;
        transition: all 0.3s;

        &:hover {
          border-color: #40a9ff;
        }

        &:focus {
          border-color: #1890ff;
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
          outline: none;
        }
      }

      .btn-delete {
        padding: 6px;
        border: none;
        background: transparent;
        color: #ff4d4f;
        cursor: pointer;
        border-radius: 4px;
        transition: all 0.3s;

        &:hover {
          background: #fff1f0;
        }

        i {
          font-size: 14px;
        }
      }
    }

    tr:hover td {
      background: #fafafa;
    }

    .text-center {
      text-align: center;
      padding: 24px;
      color: #8c8c8c;
    }
  }
}

.dialog-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: linear-gradient(to right, #fafafa, #f5f5f5);
  border-radius: 0 0 12px 12px;

  button {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;

    &.btn-cancel {
      border: 1px solid #d9d9d9;
      background: white;
      color: #595959;

      &:hover {
        color: #40a9ff;
        border-color: #40a9ff;
        background: rgba(24, 144, 255, 0.02);
      }
    }

    &.btn-submit {
      border: none;
      background: #1890ff;
      color: white;

      &:hover {
        background: #40a9ff;
      }

      &:disabled {
        background: #d9d9d9;
        cursor: not-allowed;
      }
    }
  }
}

.ng-invalid.ng-touched {
  border-color: #ff4d4f;
}

.validation-error {
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 4px;
} 